#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int add(int a, int b)
{
	return a + b;
}
int jian(int a, int b)
{
	return a - b;
}
int chen(int a, int b)
{
	return a * b;
}
int chu(int a, int b)
{
	return a / b;
}
void menu()
{
	printf("********************\n");
	printf("*****1.加法*********\n");
	printf("*****2.减法*********\n");
	printf("*****3.乘法*********\n");
	printf("*****4.除法*********\n");
	printf("*****4.退出*********\n");
	printf("********************\n");

}
int main()
{
	int input=0;
	int a = 0, b = 0;
	int c, d, e, f;
	do
	{
		menu();
		printf("请选择算法\n");
		scanf("%d", &input);
		switch (input)
		{
		    case 0:
				printf("退出计算器");
					break;
			case 1:
				printf("请输入两个操作数\n");
				scanf("%d %d", &a, &b);
				c=add(a, b);
				printf("%d\n", c);
				break;
			case 2:
				printf("请输入两个操作数\n");
				scanf("%d %d", &a, &b);
				 d = jian(a, b);
				printf("%d\n", d);
				break;
			case 3:
				printf("请输入两个操作数\n");
				scanf("%d %d", &a, &b);
				 e = chen(a, b);
				printf("%d\n", e);
				break;
			case 4:
				printf("请输入两个操作数\n");
				scanf("%d %d", &a, &b);
				f = chu(a, b);
				printf("%d\n", f);
				break;
		}


	} while (input);


	return 0;
}